fix(rtp_transceiver): trigger renegotiation on set_direction (closes #51)#71
Open
nightness wants to merge 1 commit intowebrtc-rs:masterfrom
Open
fix(rtp_transceiver): trigger renegotiation on set_direction (closes #51)#71nightness wants to merge 1 commit intowebrtc-rs:masterfrom
nightness wants to merge 1 commit intowebrtc-rs:masterfrom
Conversation
…ebrtc-rs#51) Per W3C WebRTC §5.5, changing an RTCRtpTransceiver's direction must trigger the negotiation-needed flag so the application knows to create a new offer/answer exchange. The internal set_direction() had a TODO noting this was missing. The fix lives in the public RTCRtpTransceiver::set_direction() wrapper, which already holds &mut RTCPeerConnection and can call trigger_negotiation_needed() directly after detecting a direction change. Also broaden trigger_negotiation_needed() visibility from pub(super) to pub(crate) so rtp_transceiver/mod.rs can reach it. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
e08e980 to
6ad88b6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
RTCRtpTransceiver::set_direction()now callstrigger_negotiation_needed()on the peer connection when the direction actually changes, per W3C WebRTC §5.5rtp_transceiver/mod.rs), which already holds&mut RTCPeerConnection— no architectural changes needed//TODOcomment ininternal.rsis removedtrigger_negotiation_needed()visibility is broadened frompub(super)topub(crate)to allow the call fromrtp_transceiver/mod.rsTest plan
cargo buildpassescargo test -p rtcpasses (246 tests)transceiver.set_direction(RTCRtpTransceiverDirection::Inactive)causeson_negotiation_neededto fire on the peer connection; calling it with the same direction does not🤖 Generated with Claude Code